<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="a b c box d e f">
    </div>
    <button>点击</button>
    <script>
        var divEle = document.querySelector("div");
        var btnEle = document.querySelector("button");
        btnEle.onclick = function () {
            var str = divEle.className ; 
            divEle.className = delEle( str , 'box' );
            console.log(divEle);
        }
        console.log(divEle);
        function delEle ( str , e ){
            var arr = str.split(" ");
            var a = arr.indexOf(e);
            arr.splice(a,1); 
            var strA = arr.join(" ");
            return strA ; 
        }
    </script>
</body>
</html>